import 'package:f_demo_two/components/shop_list.dart';
import 'package:flutter/material.dart';

class MyApp16 extends StatelessWidget {
  const MyApp16({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        //导航条
        appBar: AppBar(
          title: const Text('ListView使用',
              style: TextStyle(
                  fontSize: 20,
                  fontWeight: FontWeight.bold,
                  color: Colors.white)),
          backgroundColor: Colors.pink,
          centerTitle: true,
        ),
        //主体区域
        body: ListView.separated(
          //列表的每一项
          itemBuilder: (BuildContext context, int index) {
            return Container();
          },
          //分割线
          separatorBuilder: (BuildContext context, int index) {
            return Container(
              // height: 1,
              //color: Colors.black,
              margin: EdgeInsets.only(left: 10, right: 10),
              child: const Divider(
                height: 1,
                color: Colors.orange,
              ),
            );
          },
          //列表的长度
          itemCount: 20,
        ));
  }
}
